import { Modal, Button, Icon } from 'antd';
import React from 'react';
import PropTypes from 'prop-types';
import './index.less';
export default function CallbackModel({ visible, setVisible, errorVisbleText }) {
  const handleCancel = () => {
    // 处理取消按钮点击事件
    setVisible(false);
  };

  const customFooter = () => {
    return (
      <div className="call-back-model-custom-footer">
        <Button onClick={handleCancel}>返回修改</Button>
      </div>
    );
  };

  return (
    <>
      <Modal
        visible={visible}
        onCancel={handleCancel}
        width={480}
        footer={null}
        closable={false}
        className="erro-modal"
      >
        <>
          <Icon type="close-circle" />
          <p>{errorVisbleText || '连接失败'}</p>
          {customFooter()}
        </>
      </Modal>
    </>
  );
}

CallbackModel.propTypes = {
  content: PropTypes.string,
  footer: PropTypes,
  visible: PropTypes,
  setVisible: PropTypes,
  errorVisbleText: PropTypes.string
};
